<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import Empty from 'src/components/Empty.vue';
import useLoginInfoStore from 'src/stores/useLoginInfoStore';

const isLoading = ref(false);
const rcs2Url = ref('');
const errorMsg = ref('');
const loginInfoStore = useLoginInfoStore();

onMounted(() => {
  rcs2Url.value = 'http://' + loginInfoStore.loginInfo.rcs2ServerUrl;
});

</script>
<template>
  <q-item v-if="isLoading" class="full-width full-height">
    <q-item-section avatar>
      <q-skeleton type="QAvatar" />
    </q-item-section>

    <q-item-section>
      <q-item-label>
        <q-skeleton type="text" />
      </q-item-label>
      <q-item-label caption>
        <q-skeleton type="text" width="65%" />
      </q-item-label>
    </q-item-section>
  </q-item>
  <Empty v-else-if="errorMsg" :description="errorMsg" />
  <iframe :src="rcs2Url" :key="rcs2Url"
          style="visibility: visible;height: 100%;width: 100%;border: none;"
          title="AGV调度系统"
  />
</template>
